package com.theaf.basemodule.common.model;

import com.theaf.core.annotation.FieldCn;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

/**
 * @Author:songwenke
 * @Description:
 * @Date:create in 14:49 2017/12/21
 * @Modified By:
 **/
@ApiModel("数据字典类型表")
@Entity
@Table(name = "sys_dic_type")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysDicType {
    @Id
    @FieldCn(value = "标识")
    @Column(name = "tag",unique = true)
    private String tag;
    @FieldCn(value = "名称")
    @Column(name = "name")
    private String name;
    @FieldCn(value = "备注")
    @Column(name = "remark")
    private String remark;

    @OneToMany(cascade={CascadeType.ALL})
    @JoinColumn(name="tag")
    @OrderBy("order_no ASC")
    private List<SysDic> sysDicList;
    @Override
    public String toString(){
        return "SysDicType(tag=" + this.getTag() + ", name=" + this.getName() + ", remark=" + this.getRemark()  + ")";
    }

}
